<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" >

	<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
	<link href="https://fonts.googleapis.com/css?family=Roboto+Mono" rel="stylesheet">
	<link href="https://fonts.googleapis.com/css?family=Cousine|Inconsolata" rel="stylesheet">
	<link rel="shortcut icon" type="image/png" href="/favicon.png">

	
	<link rel="stylesheet" href="/css/style.css">
	<link rel="stylesheet" href="/css/css/fontawesome-all.min.css">
	<script src="/js/main.js"></script>
	

	<!-- Begin Jekyll SEO tag v2.1.0 -->
<title>RB: Reblogging Post - Steem Developer</title>
<meta property="og:title" content="RB: Reblogging Post" />
<meta name="description" content="To reblog resteem a post we can use a custom json operation that is handled by the follow plugin" />
<meta property="og:description" content="To reblog resteem a post we can use a custom json operation that is handled by the follow plugin" />
<link rel="canonical" href="https://developer.steem.io/tutorials-ruby/reblogging_post" />
<meta property="og:url" content="https://developer.steem.io/tutorials-ruby/reblogging_post" />
<meta property="og:site_name" content="Steem Developer" />
<meta property="og:type" content="article" />
<meta property="article:published_time" content="2018-07-20T12:56:08-05:00" />
<script type="application/ld+json">
{"@context": "http://schema.org",
"@type": "BlogPosting",
"headline": "RB: Reblogging Post",
"datePublished": "2018-07-20T12:56:08-05:00",
"description": "To reblog resteem a post we can use a custom json operation that is handled by the follow plugin",
"url": "https://developer.steem.io/tutorials-ruby/reblogging_post"}</script>
<!-- End Jekyll SEO tag -->


	
</head>
<body>
<header>
	<h1>
		<button type="button" class="open-nav" id="open-nav"></button>
		<a href="/"  class="logo-link"><img src="/images/logotype_white.svg" height="40" alt="Steem Developer logo"></a>
	</h1>

	
	<form action="/search/" method="get">
		<input type="text" name="q" id="search-input" placeholder="Search">
		<input type="submit" value="Search" style="display: none;">
	</form>
	

	<div id="sidebar" class="sidebar">
	
	
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/">
		<h6 class="ctrl-nav-section title">Introduction</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/#introduction-welcome">Welcome to Steem</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/quickstart/">
		<h6 class="ctrl-nav-section title">Quickstart</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/quickstart/#quickstart-choose-library">Choose Library</a></li>
						
					
						
						<li><a href="/quickstart/#quickstart-steemd-nodes">steemd Nodes</a></li>
						
					
						
						<li><a href="/quickstart/#quickstart-testnet">Steem Testnet</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/tutorials/">
		<h6 class="ctrl-nav-section title">Tutorials</h6>
		<ul class="cont-nav-section content">
			
				
					
						<li><a href="/tutorials/#tutorials-javascript">Javascript</a></li>
					
				
					
						<li><a href="/tutorials/#tutorials-python">Python</a></li>
					
				
					
						<li><a href="/tutorials/#tutorials-ruby">Ruby</a></li>
					
				
					
						<li><a href="/tutorials/#tutorials-recipes">Recipes</a></li>
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/services/">
		<h6 class="ctrl-nav-section title">Services</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/services/#services-steemit">Steemit.com</a></li>
						
					
						
						<li><a href="/services/#services-steemconnect">SteemConnect</a></li>
						
					
						
						<li><a href="/services/#services-jussi">jussi</a></li>
						
					
						
						<li><a href="/services/#services-imagehoster">ImageHoster</a></li>
						
					
						
						<li><a href="/services/#services-sbds">SBDS</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/apidefinitions/">
		<h6 class="ctrl-nav-section title">Appbase API</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/apidefinitions/#apidefinitions-condenser-api">Condenser Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-account-by-key-api">Account By Key Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-broadcast-ops-comment">Broadcast Ops Comment</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-account-history-api">Account History Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-database-api">Database Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-follow-api">Follow Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-jsonrpc">Jsonrpc</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-market-history-api">Market History Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-network-broadcast-api">Network Broadcast Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-tags-api">Tags Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-witness-api">Witness Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-block-api">Block Api</a></li>
						
					
						
						<li><a href="/apidefinitions/#apidefinitions-broadcast-ops">Broadcast Ops</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/community/">
		<h6 class="ctrl-nav-section title">Community</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/community/#community-overview">Overview</a></li>
						
					
						
						<li><a href="/community/#community-resources">Resources</a></li>
						
					
						
						<li><a href="/community/#community-developeradvocate">Sharing & Help</a></li>
						
					
				
			
		</ul>
	</section>
	
		
    <section class="pnl-main-nav-section main-nav-section" url="/glossary/">
		<h6 class="ctrl-nav-section title">Glossary</h6>
		<ul class="cont-nav-section content">
			
				
					
					
						
						<li><a href="/glossary/#glossary-chain-basics">Chain Basics</a></li>
						
					
						
					
						
						<li><a href="/glossary/#glossary-governance">Governance</a></li>
						
					
						
						<li><a href="/glossary/#glossary-transactions">Transactions</a></li>
						
					
						
						<li><a href="/glossary/#glossary-api">API</a></li>
						
					
						
						<li><a href="/glossary/#glossary-market">Market</a></li>
						
					
				
			
		</ul>
	</section>
	
</div>


	<!--<p class="copyright">-->
	<!--<a href="https://steemit.com.com/">-->
	<!--steemit-->
	<!--</a>-->
	<!--</p>-->
	<link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">
</header>
<div class="main" id="top">
	<div class="hero">
		<h1 class="hero__h1">Steem Developer Portal </h1>
		
		<img class="hero__img" src="/images/hero.png">
		
	</div>
	<section id="tutorials-ruby-reblogging-post" class="row tutorials-ruby-reblogging-post">
	<h3>
		<a id="tutorials-ruby-reblogging-post">
			RB: Reblogging Post
			
		</a>
	</h3>
	
		<p class="description">To reblog resteem a post we can use a custom json operation that is handled by the follow plugin</p>
	

	<p><span class="fa-pull-left top-of-tutorial-repo-link"><span class="first-word">Full</span>, runnable src of <a href="https://github.com/steemit/devportal-tutorials-rb/tree/master/tutorials/14_reblogging_post">Reblogging Post</a> can be downloaded as part of the <a href="https://github.com/steemit/devportal-tutorials-rb">RB tutorials repository</a>.</span>
<br /></p>

<p>For this operation, we will use <code class="highlighter-rouge">custom_json</code> and a properly formed id and payload so that <code class="highlighter-rouge">follow_plugin</code> will pick up the reblog data and display the selected post in the feed of the account doing the reblog.</p>

<h3 id="sections">Sections</h3>

<ol>
  <li><a href="#making-the-api-call">Making the api call</a> - broadcasting the operation
    <ol>
      <li><a href="#example-api-call">Example api call</a> - make the call in code</li>
      <li><a href="#example-api-call-using-script">Example api call using script</a> - using our tutorial script</li>
      <li><a href="#example-output">Example Output</a> - output from a successful call</li>
      <li><a href="#example-error">Example Error</a> - error output from a unsuccessful call</li>
    </ol>
  </li>
  <li><a href="#custom-json-fields">Custom JSON Fields</a> - understanding the result</li>
  <li><a href="#to-run">To Run</a> - Running the example.</li>
</ol>

<h3 id="making-the-api-call">Making the api call</h3>

<p>To broadcast the operation, we can use a <code class="highlighter-rouge">Radiator::Transaction</code> instance:</p>

<div class="language-ruby highlighter-rouge"><pre class="highlight"><code><span class="n">tx</span> <span class="o">=</span> <span class="no">Radiator</span><span class="o">::</span><span class="no">Transaction</span><span class="p">.</span><span class="nf">new</span>


<span class="n">tx</span><span class="p">.</span><span class="nf">process</span><span class="p">(</span><span class="kp">true</span><span class="p">)</span>
</code></pre>
</div>

<p>Passing <code class="highlighter-rouge">true</code> to <code class="highlighter-rouge">Radiator::Transaction#process</code> will broadcast the operations queued in the <code class="highlighter-rouge">operations</code> array of the transaction.</p>

<h4 id="example-api-call">Example api call</h4>

<p>If we want to reblog, we need to form the <code class="highlighter-rouge">json</code> properly, for example:</p>

<div class="language-ruby highlighter-rouge"><pre class="highlight"><code><span class="n">data</span> <span class="o">=</span> <span class="p">[</span>
  <span class="ss">:reblog</span><span class="p">,</span> <span class="p">{</span>
    <span class="ss">account: </span><span class="n">reblogger</span><span class="p">,</span>
    <span class="ss">author: </span><span class="n">author</span><span class="p">,</span>
    <span class="ss">permlink: </span><span class="n">permlink</span>
  <span class="p">}</span>
<span class="p">]</span>

<span class="n">tx</span><span class="p">.</span><span class="nf">operations</span> <span class="o">&lt;&lt;</span> <span class="p">{</span>
  <span class="ss">type: :custom_json</span><span class="p">,</span>
  <span class="ss">id: </span><span class="s1">'follow'</span><span class="p">,</span>
  <span class="ss">required_auths: </span><span class="p">[],</span>
  <span class="ss">required_posting_auths: </span><span class="p">[</span><span class="n">reblogger</span><span class="p">],</span>
  <span class="ss">json: </span><span class="n">data</span><span class="p">.</span><span class="nf">to_json</span>
<span class="p">}</span>
</code></pre>
</div>

<h4 id="example-api-call-using-script">Example api call using script</h4>

<p>And to do the same with our tutorial script:</p>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code>ruby reblogging_post.rb https://steemit.com/@inertia/kinda-spooky
</code></pre>
</div>

<h4 id="example-output">Example Output</h4>

<p>From the example we get the following output from our script:</p>

<div class="language-json highlighter-rouge"><pre class="highlight"><code><span class="p">{</span><span class="w">
  </span><span class="nt">"jsonrpc"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2.0"</span><span class="p">,</span><span class="w">
  </span><span class="nt">"result"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
    </span><span class="nt">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"0aa41e06b2612315d32cadeb671eb1201f266dd7"</span><span class="p">,</span><span class="w">
    </span><span class="nt">"block_num"</span><span class="p">:</span><span class="w"> </span><span class="mi">24063620</span><span class="p">,</span><span class="w">
    </span><span class="nt">"trx_num"</span><span class="p">:</span><span class="w"> </span><span class="mi">19</span><span class="p">,</span><span class="w">
    </span><span class="nt">"expired"</span><span class="p">:</span><span class="w"> </span><span class="kc">false</span><span class="w">
  </span><span class="p">},</span><span class="w">
  </span><span class="nt">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">3</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre>
</div>

<p>The response we get after broadcasting the transaction gives us the transaction id (<a href="https://steemd.com/tx/0aa41e06b2612315d32cadeb671eb1201f266dd7"><code class="highlighter-rouge">0aa41e0...</code></a>), block number (<a href="https://steemd.com/b/24063620"><code class="highlighter-rouge">24063620</code></a>), and the transaction number of that block (<code class="highlighter-rouge">19</code>).</p>

<h3 id="example-error">Example Error</h3>

<p>If a post has already been reblogged by the account, we will get back an error:</p>

<div class="language-json highlighter-rouge"><pre class="highlight"><code><span class="p">{</span><span class="w">
  </span><span class="nt">"jsonrpc"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2.0"</span><span class="p">,</span><span class="w">
  </span><span class="nt">"error"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
    </span><span class="nt">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">-32000</span><span class="p">,</span><span class="w">
    </span><span class="nt">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Assert Exception:blog_itr == blog_comment_idx.end(): Account has already reblogged this post"</span><span class="p">,</span><span class="w">
    </span><span class="nt">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
      </span><span class="nt">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">10</span><span class="p">,</span><span class="w">
      </span><span class="nt">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"assert_exception"</span><span class="p">,</span><span class="w">
      </span><span class="nt">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Assert Exception"</span><span class="p">,</span><span class="w">
      </span><span class="nt">"stack"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
        </span><span class="p">{</span><span class="w">
          </span><span class="nt">"context"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
            </span><span class="nt">"level"</span><span class="p">:</span><span class="w"> </span><span class="s2">"error"</span><span class="p">,</span><span class="w">
            </span><span class="nt">"file"</span><span class="p">:</span><span class="w"> </span><span class="s2">"follow_evaluators.cpp"</span><span class="p">,</span><span class="w">
            </span><span class="nt">"line"</span><span class="p">:</span><span class="w"> </span><span class="mi">143</span><span class="p">,</span><span class="w">
            </span><span class="nt">"method"</span><span class="p">:</span><span class="w"> </span><span class="s2">"do_apply"</span><span class="p">,</span><span class="w">
            </span><span class="nt">"hostname"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w">
            </span><span class="nt">"timestamp"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2018-07-10T21:33:11"</span><span class="w">
          </span><span class="p">},</span><span class="w">
          </span><span class="nt">"format"</span><span class="p">:</span><span class="w"> </span><span class="s2">"blog_itr == blog_comment_idx.end(): Account has already reblogged this post"</span><span class="p">,</span><span class="w">
          </span><span class="nt">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
          </span><span class="p">}</span><span class="w">
        </span><span class="p">},</span><span class="w">
        </span><span class="p">{</span><span class="w">
          </span><span class="nt">"context"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
            </span><span class="nt">"level"</span><span class="p">:</span><span class="w"> </span><span class="s2">"warn"</span><span class="p">,</span><span class="w">
            </span><span class="nt">"file"</span><span class="p">:</span><span class="w"> </span><span class="s2">"follow_evaluators.cpp"</span><span class="p">,</span><span class="w">
            </span><span class="nt">"line"</span><span class="p">:</span><span class="w"> </span><span class="mi">216</span><span class="p">,</span><span class="w">
            </span><span class="nt">"method"</span><span class="p">:</span><span class="w"> </span><span class="s2">"do_apply"</span><span class="p">,</span><span class="w">
            </span><span class="nt">"hostname"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w">
            </span><span class="nt">"timestamp"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2018-07-10T21:33:11"</span><span class="w">
          </span><span class="p">},</span><span class="w">
          </span><span class="nt">"format"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w">
          </span><span class="nt">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
            </span><span class="nt">"o"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
              </span><span class="nt">"account"</span><span class="p">:</span><span class="w"> </span><span class="s2">"social"</span><span class="p">,</span><span class="w">
              </span><span class="nt">"author"</span><span class="p">:</span><span class="w"> </span><span class="s2">"inertia"</span><span class="p">,</span><span class="w">
              </span><span class="nt">"permlink"</span><span class="p">:</span><span class="w"> </span><span class="s2">"kinda-spooky"</span><span class="w">
            </span><span class="p">}</span><span class="w">
          </span><span class="p">}</span><span class="w">
        </span><span class="p">},</span><span class="w">
        </span><span class="p">{</span><span class="w">
          </span><span class="nt">"context"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
            </span><span class="nt">"level"</span><span class="p">:</span><span class="w"> </span><span class="s2">"warn"</span><span class="p">,</span><span class="w">
            </span><span class="nt">"file"</span><span class="p">:</span><span class="w"> </span><span class="s2">"generic_custom_operation_interpreter.hpp"</span><span class="p">,</span><span class="w">
            </span><span class="nt">"line"</span><span class="p">:</span><span class="w"> </span><span class="mi">195</span><span class="p">,</span><span class="w">
            </span><span class="nt">"method"</span><span class="p">:</span><span class="w"> </span><span class="s2">"apply"</span><span class="p">,</span><span class="w">
            </span><span class="nt">"hostname"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w">
            </span><span class="nt">"timestamp"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2018-07-10T21:33:11"</span><span class="w">
          </span><span class="p">},</span><span class="w">
          </span><span class="nt">"format"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w">
          </span><span class="nt">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
            </span><span class="nt">"outer_o"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
              </span><span class="nt">"required_auths"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">

              </span><span class="p">],</span><span class="w">
              </span><span class="nt">"required_posting_auths"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
                </span><span class="s2">"social"</span><span class="w">
              </span><span class="p">],</span><span class="w">
              </span><span class="nt">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"follow"</span><span class="p">,</span><span class="w">
              </span><span class="nt">"json"</span><span class="p">:</span><span class="w"> </span><span class="s2">"[\"reblog\",{\"account\":\"social\",\"author\":\"inertia\",\"permlink\":\"kinda-spooky\"}]"</span><span class="w">
            </span><span class="p">}</span><span class="w">
          </span><span class="p">}</span><span class="w">
        </span><span class="p">},</span><span class="w">
        </span><span class="p">{</span><span class="w">
          </span><span class="nt">"context"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
            </span><span class="nt">"level"</span><span class="p">:</span><span class="w"> </span><span class="s2">"warn"</span><span class="p">,</span><span class="w">
            </span><span class="nt">"file"</span><span class="p">:</span><span class="w"> </span><span class="s2">"database.cpp"</span><span class="p">,</span><span class="w">
            </span><span class="nt">"line"</span><span class="p">:</span><span class="w"> </span><span class="mi">3221</span><span class="p">,</span><span class="w">
            </span><span class="nt">"method"</span><span class="p">:</span><span class="w"> </span><span class="s2">"_apply_transaction"</span><span class="p">,</span><span class="w">
            </span><span class="nt">"hostname"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w">
            </span><span class="nt">"timestamp"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2018-07-10T21:33:11"</span><span class="w">
          </span><span class="p">},</span><span class="w">
          </span><span class="nt">"format"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w">
          </span><span class="nt">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
            </span><span class="nt">"op"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
              </span><span class="nt">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"custom_json_operation"</span><span class="p">,</span><span class="w">
              </span><span class="nt">"value"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
                </span><span class="nt">"required_auths"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">

                </span><span class="p">],</span><span class="w">
                </span><span class="nt">"required_posting_auths"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
                  </span><span class="s2">"social"</span><span class="w">
                </span><span class="p">],</span><span class="w">
                </span><span class="nt">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"follow"</span><span class="p">,</span><span class="w">
                </span><span class="nt">"json"</span><span class="p">:</span><span class="w"> </span><span class="s2">"[\"reblog\",{\"account\":\"social\",\"author\":\"inertia\",\"permlink\":\"kinda-spooky\"}]"</span><span class="w">
              </span><span class="p">}</span><span class="w">
            </span><span class="p">}</span><span class="w">
          </span><span class="p">}</span><span class="w">
        </span><span class="p">},</span><span class="w">
        </span><span class="p">{</span><span class="w">
          </span><span class="nt">"context"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
            </span><span class="nt">"level"</span><span class="p">:</span><span class="w"> </span><span class="s2">"warn"</span><span class="p">,</span><span class="w">
            </span><span class="nt">"file"</span><span class="p">:</span><span class="w"> </span><span class="s2">"database.cpp"</span><span class="p">,</span><span class="w">
            </span><span class="nt">"line"</span><span class="p">:</span><span class="w"> </span><span class="mi">3227</span><span class="p">,</span><span class="w">
            </span><span class="nt">"method"</span><span class="p">:</span><span class="w"> </span><span class="s2">"_apply_transaction"</span><span class="p">,</span><span class="w">
            </span><span class="nt">"hostname"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w">
            </span><span class="nt">"timestamp"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2018-07-10T21:33:11"</span><span class="w">
          </span><span class="p">},</span><span class="w">
          </span><span class="nt">"format"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w">
          </span><span class="nt">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
            </span><span class="nt">"trx"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
              </span><span class="nt">"ref_block_num"</span><span class="p">:</span><span class="w"> </span><span class="mi">12404</span><span class="p">,</span><span class="w">
              </span><span class="nt">"ref_block_prefix"</span><span class="p">:</span><span class="w"> </span><span class="mi">1445149887</span><span class="p">,</span><span class="w">
              </span><span class="nt">"expiration"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2018-07-10T21:43:09"</span><span class="p">,</span><span class="w">
              </span><span class="nt">"operations"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
                </span><span class="p">{</span><span class="w">
                  </span><span class="nt">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"custom_json_operation"</span><span class="p">,</span><span class="w">
                  </span><span class="nt">"value"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
                    </span><span class="nt">"required_auths"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">

                    </span><span class="p">],</span><span class="w">
                    </span><span class="nt">"required_posting_auths"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
                      </span><span class="s2">"social"</span><span class="w">
                    </span><span class="p">],</span><span class="w">
                    </span><span class="nt">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"follow"</span><span class="p">,</span><span class="w">
                    </span><span class="nt">"json"</span><span class="p">:</span><span class="w"> </span><span class="s2">"[\"reblog\",{\"account\":\"social\",\"author\":\"inertia\",\"permlink\":\"kinda-spooky\"}]"</span><span class="w">
                  </span><span class="p">}</span><span class="w">
                </span><span class="p">}</span><span class="w">
              </span><span class="p">],</span><span class="w">
              </span><span class="nt">"extensions"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">

              </span><span class="p">],</span><span class="w">
              </span><span class="nt">"signatures"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
                </span><span class="s2">"1c063e22868f107dbafaa0452d86cfe19894f2f7fc3ea46b5c73dc7906edcd88244548f001c1d128aa07f862819e80e2f46b6cd74c6769d1d48ef4ad1f147b4dab"</span><span class="w">
              </span><span class="p">]</span><span class="w">
            </span><span class="p">}</span><span class="w">
          </span><span class="p">}</span><span class="w">
        </span><span class="p">},</span><span class="w">
        </span><span class="p">{</span><span class="w">
          </span><span class="nt">"context"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
            </span><span class="nt">"level"</span><span class="p">:</span><span class="w"> </span><span class="s2">"warn"</span><span class="p">,</span><span class="w">
            </span><span class="nt">"file"</span><span class="p">:</span><span class="w"> </span><span class="s2">"database.cpp"</span><span class="p">,</span><span class="w">
            </span><span class="nt">"line"</span><span class="p">:</span><span class="w"> </span><span class="mi">788</span><span class="p">,</span><span class="w">
            </span><span class="nt">"method"</span><span class="p">:</span><span class="w"> </span><span class="s2">"push_transaction"</span><span class="p">,</span><span class="w">
            </span><span class="nt">"hostname"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w">
            </span><span class="nt">"timestamp"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2018-07-10T21:33:11"</span><span class="w">
          </span><span class="p">},</span><span class="w">
          </span><span class="nt">"format"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w">
          </span><span class="nt">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
            </span><span class="nt">"trx"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
              </span><span class="nt">"ref_block_num"</span><span class="p">:</span><span class="w"> </span><span class="mi">12404</span><span class="p">,</span><span class="w">
              </span><span class="nt">"ref_block_prefix"</span><span class="p">:</span><span class="w"> </span><span class="mi">1445149887</span><span class="p">,</span><span class="w">
              </span><span class="nt">"expiration"</span><span class="p">:</span><span class="w"> </span><span class="s2">"2018-07-10T21:43:09"</span><span class="p">,</span><span class="w">
              </span><span class="nt">"operations"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
                </span><span class="p">{</span><span class="w">
                  </span><span class="nt">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"custom_json_operation"</span><span class="p">,</span><span class="w">
                  </span><span class="nt">"value"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
                    </span><span class="nt">"required_auths"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">

                    </span><span class="p">],</span><span class="w">
                    </span><span class="nt">"required_posting_auths"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
                      </span><span class="s2">"social"</span><span class="w">
                    </span><span class="p">],</span><span class="w">
                    </span><span class="nt">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"follow"</span><span class="p">,</span><span class="w">
                    </span><span class="nt">"json"</span><span class="p">:</span><span class="w"> </span><span class="s2">"[\"reblog\",{\"account\":\"social\",\"author\":\"inertia\",\"permlink\":\"kinda-spooky\"}]"</span><span class="w">
                  </span><span class="p">}</span><span class="w">
                </span><span class="p">}</span><span class="w">
              </span><span class="p">],</span><span class="w">
              </span><span class="nt">"extensions"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">

              </span><span class="p">],</span><span class="w">
              </span><span class="nt">"signatures"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w">
                </span><span class="s2">"1c063e22868f107dbafaa0452d86cfe19894f2f7fc3ea46b5c73dc7906edcd88244548f001c1d128aa07f862819e80e2f46b6cd74c6769d1d48ef4ad1f147b4dab"</span><span class="w">
              </span><span class="p">]</span><span class="w">
            </span><span class="p">}</span><span class="w">
          </span><span class="p">}</span><span class="w">
        </span><span class="p">}</span><span class="w">
      </span><span class="p">]</span><span class="w">
    </span><span class="p">}</span><span class="w">
  </span><span class="p">},</span><span class="w">
  </span><span class="nt">"id"</span><span class="p">:</span><span class="w"> </span><span class="mi">3</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre>
</div>

<p>This indicates that the operation was not included in the blockchain because it was already reblogged in the past.</p>

<h3 id="custom-json-fields">Custom JSON Fields</h3>

<p>Broadcasting a <code class="highlighter-rouge">custom_json</code> operation will require the following fields:</p>

<ul>
  <li><code class="highlighter-rouge">id</code> - set to <code class="highlighter-rouge">follow</code> to indicate that this operation is handled by the <code class="highlighter-rouge">follow_plugin</code></li>
  <li><code class="highlighter-rouge">required_auths</code> - leave this as an empty JSON Array, we only need the posting authority</li>
  <li><code class="highlighter-rouge">required_posting_auths</code> - JSON Array containing the account name with the posting authority</li>
  <li><code class="highlighter-rouge">json</code> - the actual payload of the operation, containing a JSON Array:
    <ul>
      <li>First element - <code class="highlighter-rouge">reblog</code></li>
      <li>Second element - JSON Object containing:
        <ul>
          <li><code class="highlighter-rouge">account</code> - account that is doing the reblog op</li>
          <li><code class="highlighter-rouge">author</code> - author of the post being reblogged</li>
          <li><code class="highlighter-rouge">permlink</code> - permlink of the post being reblogged</li>
        </ul>
      </li>
    </ul>
  </li>
</ul>

<h3 id="to-run">To Run</h3>

<p>First, set up your workstation using the steps provided in <a href="https://developers.steem.io/tutorials-ruby/getting_started">Getting Started</a>.  Then you can create and execute the script (or clone from this repository):</p>

<ul>
  <li><code class="highlighter-rouge">&lt;url&gt;</code></li>
</ul>

<div class="language-bash highlighter-rouge"><pre class="highlight"><code>git clone git@github.com:steemit/devportal-tutorials-rb.git
<span class="nb">cd </span>devportal-tutorials-rb/tutorials/14_reblogging_post
bundle install
ruby reblogging_post.rb &lt;url&gt;
</code></pre>
</div>

<hr />

</section>

</div>
<div class="footer">
	<a href="#">Back to top</a>
</div>
<script>
    document.getElementById("open-nav").addEventListener("click", function () {
        document.body.classList.toggle("nav-open");
    });
</script>
</body>
</html>


<script src="/js/adjust.js"></script>

